package _0812;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo {
    public static void main(String[] args) {
        Collection<String> collection = new ArrayList<>();
        collection.add("one");
        collection.add("two");
        collection.add("three");
        collection.add("four");
        System.out.println(collection);
        System.out.println("集合大小为:" + collection.size());
        System.out.println("集合是否为空:" + collection.isEmpty());

        collection.clear();
        System.out.println("集合已清空");
        System.out.println(collection);
        System.out.println("集合大小为:" + collection.size());
        System.out.println("集合是否为空:" + collection.isEmpty());
    }
}
